package com.softteem.music_sys.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.softteem.music_sys.entity.Admin;
import com.softteem.music_sys.mapper.AdminMapper;
import org.springframework.stereotype.Service;
@Service
public class AdminServiceimpl extends ServiceImpl<AdminMapper, Admin>implements AdminService {
    @Override
    public boolean add(Admin admin) {
        return false;
    }

    @Override
    public boolean addAdmin(Admin admin) {
        QueryWrapper<Admin> query = Wrappers.query(Admin.class);
        query.eq("username", admin.getUsername());
        Admin a =getOne(query);
        if (a == null) {
            return false;
        }
        return sava(admin);
    }

    private boolean sava(Admin admin) {
        boolean b = false;
        return b;
    }

    @Override
    public boolean login(String username, String password) {
        return false;
    }
}
